package com.whz.serial;

import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;
import java.util.Arrays;

/**
 * @Author: sinosoft
 * @Description: 单例模式 共有静态成员
 * @Date: Create in 18:32 2021/4/29
 * @Modified By:
 */
@Slf4j
public class Elvis<T> implements Serializable {
    private static final long serialVersionUID = 7657407878573280989L;
    public static final Elvis INSTANCE = new Elvis();
    private Elvis() {}

    private String[] favoriteSongs = {"Hound Dog", "Heartbreak Hotel"};

    public void printFavorites() {
        log.info(Arrays.toString(favoriteSongs));
    }

    private Object readResolve() {
        return INSTANCE;
    }

}
